<?php
namespace Modules\ShopApi\Http\Controllers\v1;
use Illuminate\Http\Request;
use Modules\AuthAdmin\Http\Requests\CommonIdRequest;
use Modules\ShopApi\Models\ShopPicture as ShopPictureModel;
use Modules\ShopApi\Models\ShopConsult as ShopConsultModel;
use Modules\ShopApi\Models\ShopConsultEvaluate as ShopConsultEvaluateModel;
class ConsultController extends CommonController
{ 
	/**
	 * @name  咨询轮播图
	 * @method  GET
	 * @return  JSON
	 */
    public function get_consult_banner(Request $request)
    {
		return (new ShopPictureModel())->get_consult_banner();
    }
	/**
	 * @name  咨询列表
	 * @method  GET
	 * @param  page int 页码	
	 * @param  name string 咨询标题
	 * @return  JSON
	 */
    public function get_consult(Request $request)
    {
		return (new ShopConsultModel())->get_consult($request->all());
    }
	/**
	 * @name  咨询详情
	 * @method  GET
	 * @param  id int 咨询id	
	 * @return  JSON
	 */
    public function get_consult_detail(CommonIdRequest $request)
    {
		return (new ShopConsultModel())->get_consult_detail($request->get('id'));
    }
	/**
	 * @name  咨询点赞
	 * @method  post
	 * @param  id int 咨询id	
	 * @return  JSON
	 */
    public function set_consult_like(CommonIdRequest $request)
    {
		return (new ShopConsultModel())->set_consult_like($request->get('id'));
    }
	/**
	 * @name  咨询评论
	 * @method  post
	 * @param  id int 咨询id	
	 * @param  pid int 上级评价ID，0表示顶级	
	 * @param  content string 评价内容
	 * @return  JSON
	 */
    public function set_consult_evaluate(CommonIdRequest $request)
    {
		return (new ShopConsultEvaluateModel())->set_consult_evaluate($request->all());
    }
	/**
	 * @name  一级评论列表
	 * @method  GET
	 * @param  page int 页码
	 * @param  id int 咨询id	
	 * @return  JSON
	 */
    public function get_consult_evaluate_list(Request $request)
    {
		return (new ShopConsultEvaluateModel())->get_consult_evaluate_list($request->get('id'));
    }
	/**
	 * @name  二级评论列表
	 * @method  GET
	 * @param  page int 页码
	 * @param  id int 咨询id
	 * @param  pid int 上级评价ID，0表示顶级
	 * @return  JSON
	 */
    public function get_consult_evaluate_one_list(Request $request)
    {
		return (new ShopConsultEvaluateModel())->get_consult_evaluate_one_list($request->all());
    }
}
